You can remove all comments from unregistered users in WordPress.
- Log into phpMyAdmin (cPanel / Plesk / Web Hosting / Managed WordPress).
- Select the database for your WordPress site in the left-hand column.
- Click the SQL tab.
- Paste the following query in the query field.
DELETE wp_comments, wp_commentmeta FROM wp_comments INNER JOIN wp_commentmeta WHERE wp_comments.comment_id=wp_commentmeta.comment_ID AND wp_comments.user_id = 0; DELETE FROM wp_comments WHERE user_id = 0;
Warning: If your WordPress database uses custom table prefixes, then you must replace wp_ in each command with the prefix listed in your wp-config.php file.
- Click Go.
More info